-
Notifications
You must be signed in to change notification settings - Fork 1.5k
OCPBUGS-61167: pkg/types/valication: explain overlapping internal subnets better #10039
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OCPBUGS-61167: pkg/types/valication: explain overlapping internal subnets better #10039
Conversation
|
@jhixson74: This pull request references Jira Issue OCPBUGS-61167, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/lgtm |
|
/jira refresh |
|
@tthvo: This pull request references Jira Issue OCPBUGS-61167, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
tthvo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! I just have a small suggestion above.
The unit test is quite strict in term of expected output, so we would need to fix to expect the new error message: ci/prow/unit.
| // Join subnet | ||
| if ovnsubnet, configured := getOVNSubnet(joinSubnet); !configured && validate.DoCIDRsOverlap(network, ovnsubnet) { | ||
| allErrs = append(allErrs, field.Invalid(fldPath, network.String(), fmt.Sprintf("must not overlap with OVNKubernetes default internal subnet %s", ovnsubnet.String()))) | ||
| allErrs = append(allErrs, field.Invalid(fldPath, network.String(), fmt.Sprintf("must not overlap with OVNKubernetes default internal subnet %s: please run 'openshift-install explain installconfig.networking.ovnKubernetesConfig.ipv4' for further documentation", ovnsubnet.String()))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this code checks for both ipv4 and ipv6:
installer/pkg/types/validation/installconfig.go
Lines 606 to 610 in 0278beb
| if network.IP.To4() != nil { | |
| subnetsCheck(validate.OVNIPv4JoinSubnet, validate.OVNIPv4TransitSubnet, validate.OVNIPv4MasqueradeSubnet) | |
| } else { | |
| subnetsCheck(validate.OVNIPv6JoinSubnet, validate.OVNIPv6TransitSubnet, validate.OVNIPv6MasqueradeSubnet) | |
| } |
As of now, we only have overrides for ipv4. For future proof, maybe we can use the message:
| allErrs = append(allErrs, field.Invalid(fldPath, network.String(), fmt.Sprintf("must not overlap with OVNKubernetes default internal subnet %s: please run 'openshift-install explain installconfig.networking.ovnKubernetesConfig.ipv4' for further documentation", ovnsubnet.String()))) | |
| allErrs = append(allErrs, field.Invalid(fldPath, network.String(), fmt.Sprintf("must not overlap with OVNKubernetes default internal subnet %s. To override the OVNKubernetes defaults, configure the field 'networking.ovnKubernetesConfig'", ovnsubnet.String()))) |
|
/approve Unit tests need to be fixed. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: patrickdillon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
With this PR, when machine network overlaps with the default OVN-Kubernetes internal subnet, the error message directs users to the proper documentation And the corresponding installer documentation explains the usage of /verified by @gpei |
|
@gpei: This PR has been marked as verified by In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
Let users know what to do when they get an overlapping subnet error. https://issues.redhat.com/browse/OCPBUGS-61167
0b89eb0 to
f09aa9e
Compare
tthvo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Looks good to me 👍
Just a heads up: there's currently no support for overriding IPv6 default subnets (the networking.ovnKubernetesConfig.ipv6 field isn't implemented yet). Not sure if users will find this surprising, but it is OK for me.
|
@jhixson74: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
Test again with the latest change.
/verified by @gpei |
|
@gpei: This PR has been marked as verified by In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@jhixson74: Jira Issue Verification Checks: Jira Issue OCPBUGS-61167 Jira Issue OCPBUGS-61167 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
Fix included in accepted release 4.21.0-0.nightly-2025-11-13-042845 |
Let users know what to do when they get an overlapping subnet error.
https://issues.redhat.com/browse/OCPBUGS-61167